<?php

class Application_Form_Konsumen extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
        
        $id_konsumen = new Zend_Form_Element_Hidden('id_konsumen');
        
        $nama_konsumen = new Zend_Form_Element_Text('nama_konsumen');
        $nama_konsumen->setLabel('Customer Name')->setRequired();
        
        $nama_perusahaan = new Zend_Form_Element_Text('nama_perusahaan');
        $nama_perusahaan->setLabel('Company Name')->setRequired();
        
        $alamat_konsumen = new Zend_Form_Element_Textarea('alamat_konsumen');
        $alamat_konsumen->setLabel('Address')->setRequired()->setAttribs(array('cols'=>60, 'rows'=>10));
        
        $kota = new Zend_Form_Element_Text('kota');
        $kota->setLabel('City');
        
        $provinsi = new Zend_Form_Element_Text('provinsi');
        $provinsi->setLabel('State');
        
        $negara = new Zend_Form_Element_Text('negara');
        $negara->setLabel('Country');
        
        $kode_pos = new Zend_Form_Element_Text('kode_pos');
        $kode_pos->setLabel('Postal Code')->addValidator('Digits');
        
        $no_telepon = new Zend_Form_Element_Text('no_telepon');
        $no_telepon->setLabel('Telp. Number')->addValidator('Digits')->setRequired();
        
        $fax = new Zend_Form_Element_Text('fax');
        $fax->setLabel('Faximile')->addValidator('Digits');
        
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel('E-Mail')->addValidator('EmailAddress')->setRequired();
        
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('Add Customer');
        
        $cancel = new Zend_Form_Element_Button('cancel');
        $cancel->setLabel('Cancel');
        
        $this->addElements(array($nama_konsumen, $nama_perusahaan, $alamat_konsumen, $kota, $provinsi, $negara,
                                 $kode_pos, $no_telepon, $fax, $email, $submit, $cancel, $id_konsumen));
    }
}